package com.financing.wap.service.impl;

import java.util.List;
import java.util.Random;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.financing.wap.dao.IActivitiesGroupNameDao;
import com.financing.wap.dto.ActivitiesGroupNameDTO;
import com.financing.wap.service.IActivitesGroupNameService;



@Service("activitiesGroupNameService")
public class ActivitiesGroupNameServiceImpl implements IActivitesGroupNameService{

	@Autowired
	private IActivitiesGroupNameDao activitiesGroupNameDao;
	
	
	@Override
	public String getGrpupName() throws Exception {
		List<ActivitiesGroupNameDTO> list = activitiesGroupNameDao.queryActivitiesGroupNames();
		Random r = new Random(System.currentTimeMillis());
		ActivitiesGroupNameDTO activitiesGroupName = list.get(r.nextInt(list.size()));
		return activitiesGroupName.getFpActivitiesName();
	}

}
